gtk4.git
5 years agosortlistmodel: Fix a crash
Matthias Clasen [Fri, 24 Jul 2020 14:40:55 +0000 (10:40 -0400)]
sortlistmodel: Fix a crash

5 years agodropdown: Fix popup sizing
Matthias Clasen [Fri, 24 Jul 2020 13:07:45 +0000 (09:07 -0400)]
dropdown: Fix popup sizing

Setting a width request is not quite enough, since
gtk_widget_set_size_request() only queues a resize
when the widget is visible. Explicitly force one
here. Without this, the popup sometimes shows up
too small.

5 years agoMerge branch 'fix-gdk-array-msvc' into 'master'
Timm Bäder [Fri, 24 Jul 2020 09:28:21 +0000 (09:28 +0000)]
Merge branch 'fix-gdk-array-msvc' into 'master'

gdk/gdkarrayimpl.c: Fix build on Visual Studio

See merge request GNOME/gtk!2279

5 years agogdk/gdkarrayimpl.c: Fix build on Visual Studio
Chun-wei Fan [Fri, 24 Jul 2020 08:25:24 +0000 (16:25 +0800)]
gdk/gdkarrayimpl.c: Fix build on Visual Studio

It seems like initializing something to an empty array using `{}` is a GCCism,
so just stuff a 0 within the braces to accomplish the same thing.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 24 Jul 2020 02:58:51 +0000 (02:58 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

filechooser: Remove a leftover signal emission

Closes #2942

See merge request GNOME/gtk!2276

5 years agodocs: Work around escaping bugs
Matthias Clasen [Thu, 23 Jul 2020 20:14:33 +0000 (16:14 -0400)]
docs: Work around escaping bugs

This is truly a russian doll of documentation formats:
a string containing <> inside an xml fragment in an |[ ]|
gtk-doc example in markdown in a doc comment.

Sadly, something gets escaping wrong, so the <> end up
literally in the docbook and mess up the last step of
our document formatting, even after turning them into
entities.

Work around this with an extra level of entities that
really shouldn't be necessary.

5 years agodocs: Pass --standalone to pandoc
Matthias Clasen [Thu, 23 Jul 2020 19:46:06 +0000 (15:46 -0400)]
docs: Pass --standalone to pandoc

This flag causes pandoc to emit a proper doctype
declaration and, crucially, namespace declarations
for the xlink namespace that it insists on using
for href attributes. Without this, putting external
links in md documents doesn't survive the journey
through xml.

5 years agodocs: Improve shortcut trigger docs
Matthias Clasen [Thu, 23 Jul 2020 16:57:08 +0000 (12:57 -0400)]
docs: Improve shortcut trigger docs

Point out the need to escape <> in xml.

5 years agodocs: Explain the shortcutcontroller example a bit
Matthias Clasen [Thu, 23 Jul 2020 16:43:46 +0000 (12:43 -0400)]
docs: Explain the shortcutcontroller example a bit

Add a reference to the the syntax for shortcut actions
in builder files.

5 years agofilechooser: Remove a leftover signal emission
Matthias Clasen [Thu, 23 Jul 2020 11:58:57 +0000 (07:58 -0400)]
filechooser: Remove a leftover signal emission

Commit 0145809a94667c75ed4a4 replace the response-requested
signal with an action, but didn't actually remove the emission
of that no-longer-existing signal.

Fixes: #2942
5 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Thu, 23 Jul 2020 14:34:33 +0000 (14:34 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Wip/otte/for master

See merge request GNOME/gtk!2277

5 years agosearchenginemodel: Remove unused code
Benjamin Otte [Thu, 23 Jul 2020 01:35:26 +0000 (03:35 +0200)]
searchenginemodel: Remove unused code

5 years agosearchengine: Remove unused set_recursive() call
Benjamin Otte [Thu, 23 Jul 2020 01:06:42 +0000 (03:06 +0200)]
searchengine: Remove unused set_recursive() call

5 years agoUpdate Romanian translation
Florentina Mușat [Thu, 23 Jul 2020 10:33:16 +0000 (10:33 +0000)]
Update Romanian translation

5 years agoUpdate Romanian translation
Florentina Mușat [Thu, 23 Jul 2020 10:32:08 +0000 (10:32 +0000)]
Update Romanian translation

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 23 Jul 2020 00:19:15 +0000 (00:19 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2275

5 years agoNEWS: Updates
Matthias Clasen [Wed, 22 Jul 2020 23:51:27 +0000 (19:51 -0400)]
NEWS: Updates

5 years agomigration guide: Add some tables
Matthias Clasen [Wed, 22 Jul 2020 23:38:58 +0000 (19:38 -0400)]
migration guide: Add some tables

Add a table mapping event signals to their event controller
replacements, and a table mapping former GtkContainer
subclasses to their gtk_container_add replacement.

5 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Wed, 22 Jul 2020 18:08:24 +0000 (18:08 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

timsort: Actually 0-terminate the array in get_runs()

See merge request GNOME/gtk!2274

5 years agotimsort: Actually 0-terminate the array in get_runs()
Benjamin Otte [Wed, 22 Jul 2020 16:59:22 +0000 (18:59 +0200)]
timsort: Actually 0-terminate the array in get_runs()

This could cause SEGVs when changing the sort during an ongoing sort
operation.

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Wed, 22 Jul 2020 13:27:26 +0000 (13:27 +0000)]
Update Ukrainian translation

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Wed, 22 Jul 2020 13:22:09 +0000 (13:22 +0000)]
Update Ukrainian translation

5 years agoMerge branch 'wip/otte/sortlistmodel2' into 'master'
Matthias Clasen [Wed, 22 Jul 2020 13:15:45 +0000 (13:15 +0000)]
Merge branch 'wip/otte/sortlistmodel2' into 'master'

Massively refactor and improve sortlistmodel

See merge request GNOME/gtk!2273

5 years agoUpdate POTFILES.in
Piotr Drąg [Wed, 22 Jul 2020 13:01:05 +0000 (15:01 +0200)]
Update POTFILES.in

5 years agogtk-demo: Add a progress bar when the colors demo resorts
Benjamin Otte [Wed, 22 Jul 2020 01:18:33 +0000 (03:18 +0200)]
gtk-demo: Add a progress bar when the colors demo resorts

5 years agosortlistmodel: Add progress estimation
Benjamin Otte [Wed, 22 Jul 2020 00:50:58 +0000 (02:50 +0200)]
sortlistmodel: Add progress estimation

5 years agotimsort: Add progress estimation
Benjamin Otte [Sun, 12 Jul 2020 15:57:03 +0000 (17:57 +0200)]
timsort: Add progress estimation

5 years agosortlistmodel: Make key generation part of the step function
Benjamin Otte [Tue, 21 Jul 2020 23:43:59 +0000 (01:43 +0200)]
sortlistmodel: Make key generation part of the step function

SSave the missing keys as a bitset and iterate over that bitset in the
step function.

Solves the problem with a large UI block at the beginning of a sort
operation when all the keys were generated, in particular when key
generation was slow.

Benchmarks for maximum time taken by a single main loop callback:

     initial sort with complex GFileInfo keys
                       old      new
      32,000 items   137ms      3ms
     128,000 items   520ms     31ms

     initial sort with string keys
                       old      new
      32,000 items   187ms      1ms
     128,000 items   804ms      3ms

5 years agogtk-demo: Make colors demo do incremental sorting
Benjamin Otte [Tue, 21 Jul 2020 23:43:40 +0000 (01:43 +0200)]
gtk-demo: Make colors demo do incremental sorting

5 years agosortlistmodel: Properly compute runs
Benjamin Otte [Tue, 21 Jul 2020 02:50:05 +0000 (04:50 +0200)]
sortlistmodel: Properly compute runs

When updating a (partially) sorted model, take the known runs for the
existing sort and apply them to the new sort. That way, we don't have to
check the whole model again.

Benchmarks:

      appending half the items to a model of strings
                        old      new
      512,000 items   437ms    389ms
    1,024,000 items  1006ms    914ms

      appending 10% of the items to a model of strings
                        old      new
      512,000 items   206ms    132ms
    1,024,000 items   438ms    301ms

      appending 1 item to a model of strings
                        old      new
       64,000 items   1.8ms   0.00ms
      512,000 items     ---   0.01ms

5 years agosortlistmodel: Make sort stable again
Benjamin Otte [Tue, 21 Jul 2020 02:06:13 +0000 (04:06 +0200)]
sortlistmodel: Make sort stable again

Previously, the sort was not stable when items were added/removed while
sorting or the sort algorithm was changed.

Now the sort looks at the item position (via the key's location in the
keys array) to make sure each comparison stays stable with respect to
this position.

5 years agomultisorter: Implement GtkSortKeys
Benjamin Otte [Mon, 20 Jul 2020 20:24:36 +0000 (22:24 +0200)]
multisorter: Implement GtkSortKeys

5 years agotreelistrowsorter: Implement GtkSortKeys
Benjamin Otte [Sun, 19 Jul 2020 02:58:06 +0000 (04:58 +0200)]
treelistrowsorter: Implement GtkSortKeys

5 years agonumericsorter: Implement GtkSortKeys
Benjamin Otte [Thu, 16 Jul 2020 12:03:09 +0000 (14:03 +0200)]
numericsorter: Implement GtkSortKeys

5 years agostringsorter: Implement GtkSortKeys
Benjamin Otte [Wed, 15 Jul 2020 18:28:45 +0000 (20:28 +0200)]
stringsorter: Implement GtkSortKeys

5 years agosortkeys: Add an equal sort keys
Benjamin Otte [Thu, 16 Jul 2020 10:05:45 +0000 (12:05 +0200)]
sortkeys: Add an equal sort keys

Compares every element as equal.
This is useful when sorters are in an invalid configuration.

5 years agosortlistmodel: Use GtkSortKeys
Benjamin Otte [Tue, 21 Jul 2020 01:40:28 +0000 (03:40 +0200)]
sortlistmodel: Use GtkSortKeys

This massively speeds up sorting with expensive sort functions that it's
the most worthwhile optimization of this whole branch.
It's slower for simple sort functions though.

It's also quite a lot slower when the model doesn't support sort keys
(like GtkCustomSorter), but all the other sorters do support keys.

Of course, this depends on the number of items in the model - the number
of comparisons scales O(N * log N) while the overhead for key handling
scales O(N).
So as the log N part grows, generating keys gets more and more
beneficial.

Benchmarks:

       initial sort of a GFileInfo model with display-name keys
                       items     keys
         8,000 items   715ms     50ms
        64,000 items     ---    554ms

       initial sort of a GFileInfo model with complex keys
                       items     keys
        64,000 items   340ms    295ms
       128,000 items   641ms    605ms

       removing half a GFileInfo model with display-name keys
       (no comparisons, just key freeing overhead of a complex sorter)
                       items     keys
       512,000 items    14ms     21ms
     2,048,000 items    40ms     62ms

       removing half a GFileInfo model with complex keys
       (no comparisons, just key freeing overhead of a complex sorter)
                       items     keys
       512,000 items    90ms    237ms
     2,048,000 items   247ms    601ms

5 years agosorter: Introduce GtkSortKeys
Benjamin Otte [Wed, 15 Jul 2020 18:17:55 +0000 (20:17 +0200)]
sorter: Introduce GtkSortKeys

GtkSortKeys is an immutable struct that can be used to manage "sort
keys" for items.

Sort keys are memory that is created specifically for sorting. Because
sorting involves lots of comparisons, it's a good idea to prepare the
data relevant for sorting in advance and sort on that data.

In measurements with a PropertyExpression on a string sorter, it's about
??? faster

5 years agosortlistmodel: Split the SortItem into 2 arrays
Benjamin Otte [Tue, 21 Jul 2020 01:09:10 +0000 (03:09 +0200)]
sortlistmodel: Split the SortItem into 2 arrays

Instead of one item keeping the item + its position and sorting that
list, keep the items in 1 array and put the positions into a 2nd array.

This is generally slower while sorting, but allows multiple improvements:

1. We can replace items with keys
   This allows avoiding multiple slow lookups when using complex
   comparisons

2. We can keep multiple position arrays
   This allows doing a sorting in the background without actually
   emitting items-changed() until the array is completely sorted.

3. The main list tracks the items in the original model
   So only a single memmove() is necessary there, while the old version
   had to upgrade the position in every item.
Benchmarks:

        sorting a model of simple strings
                          old      new
        256,000 items   256ms    268ms
        512,000 items   569ms    638ms

        sorting a model of file trees, directories first, by size
                          old      new
         64,000 items   350ms    364ms
        128,000 items   667ms    691ms

        removing half the model
                          old      new
        512,000 items    24ms     15ms
      1,024,000 items    49ms     25ms

5 years agosortlistmodel: Add an incremental property
Benjamin Otte [Tue, 21 Jul 2020 00:50:45 +0000 (02:50 +0200)]
sortlistmodel: Add an incremental property

Also refactor a large part of the sortmodel to make this convenient.

A large amount of time has been spent on getting items-changed regions
minimized.

5 years agotestsuite: Add exhaustive sortlistmodel test
Benjamin Otte [Sun, 12 Jul 2020 04:53:06 +0000 (06:53 +0200)]
testsuite: Add exhaustive sortlistmodel test

This is basically a copy/paste from the filterlistmodel test, but
adapted for sorting.

5 years agosortlistmodel: Make the sort callback useful
Benjamin Otte [Mon, 20 Jul 2020 23:40:06 +0000 (01:40 +0200)]
sortlistmodel: Make the sort callback useful

1. Run step() for a while to avoid very short steps
   This way, we batch items-changed() emissions.

2. Track the change region accurately
   This way, we can avoid invalidating the whole list if our step just
   touched a small part of a huge list.
   As this is a merge sort, this is a common occurence when we're buys
   merging chunks: The rest of the model outside those chunks isn't
   changed.

Note that the tracking is accurate: It determines the minimum change
region in the model.

This will be important, because the testsuite is going to test this.

5 years agotimsort: Add change tracking to gtk_tim_sort_step()
Benjamin Otte [Sun, 12 Jul 2020 02:20:19 +0000 (04:20 +0200)]
timsort: Add change tracking to gtk_tim_sort_step()

5 years agotimsort: Add gtk_tim_sort_set_max_merge_size()
Benjamin Otte [Sat, 18 Jul 2020 02:45:46 +0000 (04:45 +0200)]
timsort: Add gtk_tim_sort_set_max_merge_size()

Makes the SOrtListModel responsive when incrementally sorting.

By making it configurable we can avoid losting performance in the
non-incremental case.

5 years agotimsort: Make sure merges don't take too long
Benjamin Otte [Sat, 11 Jul 2020 18:34:16 +0000 (20:34 +0200)]
timsort: Make sure merges don't take too long

Limit the size of the merged areas and thereby chunk larger merges into
smaller ones.

5 years agosortlistmodel: Make sorting incremental
Benjamin Otte [Mon, 20 Jul 2020 23:46:09 +0000 (01:46 +0200)]
sortlistmodel: Make sorting incremental

This is just an experiment so far to see how long it takes to sort.

5 years agotimsort: Add gtk_tim_sort_set_runs()
Benjamin Otte [Sat, 11 Jul 2020 04:02:58 +0000 (06:02 +0200)]
timsort: Add gtk_tim_sort_set_runs()

... and use it in the SortListModel

Setting runs allows declaring already sorted regions so the sort does
not attempt to sort them again.

This massively speeds up partial inserts where we can reuse the sorted
model as a run and only resort the newly inserted parts.

Benchmarks:

    appending half the model
                    qsort  timsort
    128,000 items    94ms     69ms
    256,000 items   202ms    143ms
    512,000 items   488ms    328ms

    appending 1 item
                    qsort  timsort
      8,000 items   1.5ms    0.0ms
     16,000 items   3.1ms    0.0ms
              ...
    512,000 items     ---    1.8ms

5 years agosortlistmodel: Use timsort
Benjamin Otte [Fri, 17 Jul 2020 00:47:22 +0000 (02:47 +0200)]
sortlistmodel: Use timsort

Simply replace the old qsort() call with a timsort() call.

This is ultimately relevant because timsort is a LOT faster in merging
to already sorted lists (think items-chaged adding some items) or
reversing an existing list (think columnview sort order changes).

Benchmarks:

    initially sorting the model
                    qsort  timsort
    128,000 items   124ms    111ms
    256,000 items   264ms    250ms

5 years agoAdd a timsort() implementation
Benjamin Otte [Sat, 11 Jul 2020 03:37:31 +0000 (05:37 +0200)]
Add a timsort() implementation

5 years agosortlistmodel: Track item positions
Benjamin Otte [Fri, 17 Jul 2020 00:28:42 +0000 (02:28 +0200)]
sortlistmodel: Track item positions

The model now tracks the original positions on top of just the items so that
it can remove items in an items-changed emission.

It now takes twice as much memory but removes items much faster.

Benchmarks:

Removing 50% of a model:
                   before    after
   250,000 items    135ms     10ms
   500,000 items    300ms     25ms

Removing 1 item:
     4,000 items    2.2ms      0ms
     8,000 items    4.6ms      0ms
   500,000 items      ---   0.01ms

5 years agosortlistmodel: Replace with an array-based model
Benjamin Otte [Thu, 16 Jul 2020 23:56:18 +0000 (01:56 +0200)]
sortlistmodel: Replace with an array-based model

This is the dumbest possible sortmodel using an array:
Just grab all the items, put them in the array, qsort() the array.

Some benchmarks (setting a new model):

  125,000 items - old: 549ms
                  new: 115ms
  250,000 items - new: 250ms

This performance can not be kept for simple additions and removals
though.

5 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 22 Jul 2020 02:58:46 +0000 (02:58 +0000)]
Update Chinese (China) translation

5 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 22 Jul 2020 02:39:21 +0000 (02:39 +0000)]
Update Chinese (China) translation

5 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 22 Jul 2020 02:20:08 +0000 (02:20 +0000)]
Update Chinese (China) translation

5 years agoMerge branch 'wip/chergert/quartz4u' into 'master'
Matthias Clasen [Tue, 21 Jul 2020 22:22:41 +0000 (22:22 +0000)]
Merge branch 'wip/chergert/quartz4u' into 'master'

Merge GDK macOS branch

See merge request GNOME/gtk!2272

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 21 Jul 2020 21:53:16 +0000 (21:53 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

gdk: Update gdkkeysyms.h

See merge request GNOME/gtk!2271

5 years agomacos: prototype new GDK backend for macOS
Christian Hergert [Thu, 23 Apr 2020 23:36:46 +0000 (16:36 -0700)]
macos: prototype new GDK backend for macOS

This is fairly substantial rewrite of the GDK backend for quartz and
renamed to macOS to allow for a greenfield implementation.

Many things have come across from the quartz implementation fairly
intact such as the eventloop integration design and discovery of
event windows from the NSEvent.

However much has been changed to fit in with the new GDK design and
how removal of child GdkWindow have been completely eliminated.
Furthermore, the new GdkPopup allows for regular NSWindow to be used
to provide popovers unlike the previous implementation.

The object design more closely follows the ideal for a GDK backend.

Views have been broken out into subclasses so that we can support
multiple GSK renderer paths such as GL and Cairo (and Metal in the
future). However mixed mode GL and Cairo will not be supported. Currently
only the Cairo renderer has been implemented.

A new frame clock implementation using CVDisplayLink provides more
accurate information about when to draw drawing the next frame. Some
testing will need to be done here to understand the power implications
of this.

This implementation has also gained edge snapping for CSD windows. Some
work was also done to ensure that CSD windows have opaque regions
registered with the display server.

     ** This is still very much a work-in-progress **

Some outstanding work that needs to be done:

 - Finish a GL context for macOS and alternate NSView for GL rendering
   (possibly using speciailized CALayer for OpenGL).
 - Input rework to ensure that we don't loose remapping of keys that was
   dropped from GDK during GTK 4 development.
 - Make sure input methods continue to work.
 - Drag-n-Drop is still very much a work in progress
 - High resolution input scrolling needs various work in GDK to land
   first before we can plumb that to NSEvent.
 - gtk/ has a number of things based on GDK_WINDOWING_QUARTZ that need
   to be updated to use the macOS backend.

But this is good enough to start playing with and breaking things which
is what I'd like to see.

5 years agogdk: disable file transfer portal on macOS
Christian Hergert [Sat, 18 Jul 2020 01:07:28 +0000 (18:07 -0700)]
gdk: disable file transfer portal on macOS

5 years agobuild: add ATK fallback subproject wrapper
Christian Hergert [Sat, 18 Jul 2020 01:05:14 +0000 (18:05 -0700)]
build: add ATK fallback subproject wrapper

Very similar to the other fallbacks we use.

5 years agobuild: squash various warnings with Clang
Christian Hergert [Sat, 18 Jul 2020 00:59:09 +0000 (17:59 -0700)]
build: squash various warnings with Clang

Otherwise we have really chatty builds that make it difficult to catch
new issues when compiling.

5 years agobuild: fix linking support on macOS with Clang
Christian Hergert [Sat, 18 Jul 2020 00:57:17 +0000 (17:57 -0700)]
build: fix linking support on macOS with Clang

This was preventing any sort of building on macOS, even though the quartz
backend is currently non-functional. Fixing this is a pre-requisite to
getting a new macOS backend compiling.

5 years agogdk: Update gdkkeysyms.h
Matthias Clasen [Tue, 21 Jul 2020 20:55:28 +0000 (16:55 -0400)]
gdk: Update gdkkeysyms.h

Run the gdkkeysyms-update.pl script to pick up several
new keysyms:
GDK_dead_lowline
GDK_dead_aboveverticalline
GDK_dead_belowverticalline
GDK_dead_longsolidusoverlay
GDK_Keyboard
GDK_WWAN
GDK_RFKill
GDK_AudioPreset

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 20 Jul 2020 22:06:42 +0000 (22:06 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

inspector: Make picking objects show them

Closes #1876

See merge request GNOME/gtk!2269

5 years agoinspector: Make picking objects show them
Matthias Clasen [Mon, 20 Jul 2020 21:30:16 +0000 (17:30 -0400)]
inspector: Make picking objects show them

Changing the selection in the object tree is
not a useful action if we are already in the
object details. Most likely, a user who picks
an object wants to inspect its details, so
just always show them.

Fixes: #1876
5 years agosortlistmodel: Test that the model is stable
Benjamin Otte [Thu, 16 Jul 2020 13:16:30 +0000 (15:16 +0200)]
sortlistmodel: Test that the model is stable

Stability is measured relative to the child model, not relative to the
previous sorter.

5 years agotestsuite: Fix a leak
Benjamin Otte [Sun, 12 Jul 2020 04:46:49 +0000 (06:46 +0200)]
testsuite: Fix a leak

5 years agoMerge branch 'barthalion/asan-runner' into 'master'
Matthias Clasen [Mon, 20 Jul 2020 16:17:49 +0000 (16:17 +0000)]
Merge branch 'barthalion/asan-runner' into 'master'

ci: Switch ASAN tests to runners tagged so

See merge request GNOME/gtk!2267

5 years agoMerge branch 'action-muxer-speedup' into 'master'
Matthias Clasen [Mon, 20 Jul 2020 16:17:17 +0000 (16:17 +0000)]
Merge branch 'action-muxer-speedup' into 'master'

Action muxer speedup

See merge request GNOME/gtk!1754

5 years agoci: Switch ASAN tests to runners tagged so
Bartłomiej Piotrowski [Mon, 20 Jul 2020 14:41:46 +0000 (16:41 +0200)]
ci: Switch ASAN tests to runners tagged so

5 years agoactionmuxer: Update docs and clean up headers
Matthias Clasen [Sun, 19 Jul 2020 21:04:11 +0000 (17:04 -0400)]
actionmuxer: Update docs and clean up headers

Update the doc comment at the top to describe the
current  functionality of GtkActionMuxer.

5 years agoactionmuxer: Use an array for accels
Matthias Clasen [Sun, 19 Jul 2020 19:11:35 +0000 (15:11 -0400)]
actionmuxer: Use an array for accels

We have a lot of accels across all the muxers, but the vast
majority has just one or two, so an array is going to be
smaller and faster for this.

5 years agoactionmuxer: Create observed_actions and groups on demand
Matthias Clasen [Sun, 19 Jul 2020 13:45:12 +0000 (09:45 -0400)]
actionmuxer: Create observed_actions and groups on demand

The vast majority of action muxers don't have observers or
groups, so we can avoid the overhead of carrying all these
empty hash tables.

5 years agoinspector: Make the actions tab work again
Matthias Clasen [Sun, 19 Jul 2020 05:56:00 +0000 (01:56 -0400)]
inspector: Make the actions tab work again

Bring back the actions tab; we don't receive
changes anymore, since GtkActionMuxer lost
the GActionGroup signals for this, and the
action observer machinery has no way to listen
for all changes.

5 years agoAdd gtk_action_muxer_list_actions
Matthias Clasen [Sun, 19 Jul 2020 05:55:13 +0000 (01:55 -0400)]
Add gtk_action_muxer_list_actions

This is needed to reinstate the actions support
in the inspector.

5 years agoactionmuxer: Stop implementing GActionGroup
Matthias Clasen [Sun, 19 Jul 2020 05:17:23 +0000 (01:17 -0400)]
actionmuxer: Stop implementing GActionGroup

Instead of implementing the GActionGroup interface
and using its signals for propagating changes up
and down the muxer hierarchy, use the GtkActionObserver
mechanism. This cuts down on the signal emission
overhead.

5 years agoactionmuxer: Port internal users
Matthias Clasen [Sun, 19 Jul 2020 02:30:02 +0000 (22:30 -0400)]
actionmuxer: Port internal users

Port all internal users of the action muxer
from the GActionGroup interface to the new
action muxer apis.

5 years agoactionmuxer: Add some more api
Matthias Clasen [Sun, 19 Jul 2020 02:28:53 +0000 (22:28 -0400)]
actionmuxer: Add some more api

We want to drop the GActionGroup interface from
GtkActionMuxer, so add the necessary api directly
to GtkActionMuxer itself.

5 years agoinspector: Remove action support temporarily
Matthias Clasen [Sun, 19 Jul 2020 02:28:03 +0000 (22:28 -0400)]
inspector: Remove action support temporarily

This is using the action muxer as a GActionGroup,
and we want to remove that interface from GtkActionMuxer.

The support will come back later.

5 years agoSpeed up action muxer setup more
Matthias Clasen [Fri, 24 Apr 2020 05:11:13 +0000 (01:11 -0400)]
Speed up action muxer setup more

Don't emit signals for group insertion/removal
if nobody is listening.

5 years agoSpeed up action muxer setup
Matthias Clasen [Fri, 24 Apr 2020 04:52:17 +0000 (00:52 -0400)]
Speed up action muxer setup

We don't need to duplicate all these action names and
emit all these signals if nobody is listening.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 20 Jul 2020 12:23:12 +0000 (12:23 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2266

5 years agogsk: Remove an unused debug flag
Matthias Clasen [Mon, 20 Jul 2020 01:21:41 +0000 (21:21 -0400)]
gsk: Remove an unused debug flag

GSK_DEBUG_DIFF was not used anywhere, so remove it.

5 years agoinspector: Add a few more debug flags
Matthias Clasen [Mon, 20 Jul 2020 01:10:12 +0000 (21:10 -0400)]
inspector: Add a few more debug flags

Add check buttons for GTK_DEBUG=constraints and
GTK_DEBUG=layout in the logs page.

5 years agoTweak the GTK_DEBUG=help output
Matthias Clasen [Mon, 20 Jul 2020 01:03:17 +0000 (21:03 -0400)]
Tweak the GTK_DEBUG=help output

I got the layout flag wrong when I added the
improved help output. It is about layout managers,
not about showing layout borders.

5 years agoMerge branch 'list-model-docs' into 'master'
Matthias Clasen [Sun, 19 Jul 2020 23:50:09 +0000 (23:50 +0000)]
Merge branch 'list-model-docs' into 'master'

List model docs

See merge request GNOME/gtk!2182

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sun, 19 Jul 2020 19:14:04 +0000 (19:14 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2265

5 years agowindowhandle: Don't use an action muxer needlessly
Matthias Clasen [Sun, 19 Jul 2020 16:52:31 +0000 (12:52 -0400)]
windowhandle: Don't use an action muxer needlessly

The api that is meant to be used here is
gtk_widget_activate_action.

5 years agoNEWS: Updates
Matthias Clasen [Sat, 18 Jul 2020 22:28:51 +0000 (18:28 -0400)]
NEWS: Updates

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 18 Jul 2020 17:31:31 +0000 (17:31 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2264

5 years agobutton: Add explicit key bindings for activation
Matthias Clasen [Sat, 18 Jul 2020 16:51:18 +0000 (12:51 -0400)]
button: Add explicit key bindings for activation

We should not rely on GtkWindow to have global
"activate-default" key bindings that happen to
fall back to activating the focus widget. This is
unreliable, since the bubbling up from the button
to the toplevel may run across other widgets that
may want to use Enter for their own purpose, and
then the button loses out. By adding our own
key bindings, the button gets to handle it before
its ancestors.

This fixes check buttons in the inspector property
list not reacting to Enter despite having focus.

5 years agotext: Claim clicks when grabbing focus
Matthias Clasen [Sat, 18 Jul 2020 15:51:45 +0000 (11:51 -0400)]
text: Claim clicks when grabbing focus

If we don't, an ancestor (such a GtkListItemWidget)
may interpret the click as "I should grab focus!",
and still our focus away. This was causing hard-to-focus
entries in the property list in the inspector.

5 years agoinspector: Add focus handling to the property editor
Matthias Clasen [Sat, 18 Jul 2020 15:53:16 +0000 (11:53 -0400)]
inspector: Add focus handling to the property editor

We want to focus the actual control here.

5 years agoeditablelabel: Stop editing on focus-out
Matthias Clasen [Sat, 18 Jul 2020 14:10:38 +0000 (10:10 -0400)]
editablelabel: Stop editing on focus-out

This is the expected behavior for the main use case,
treeview-like 'edit one cell at a time'.

5 years agofixup editing style class
Matthias Clasen [Sat, 18 Jul 2020 14:10:28 +0000 (10:10 -0400)]
fixup editing style class

5 years agoeditablelabel: Document css nodes
Matthias Clasen [Sat, 18 Jul 2020 13:55:46 +0000 (09:55 -0400)]
editablelabel: Document css nodes

Just the usual.

5 years agoeditablelabel: Add a style class while editing
Matthias Clasen [Sat, 18 Jul 2020 13:54:55 +0000 (09:54 -0400)]
editablelabel: Add a style class while editing

Add the .editing style class to the editable label
while it is editing. The idea is that themes can
show a frame around the entry.

5 years agoMerge branch 'wip/ricotz/annotations' into 'master'
Rico Tzschichholz [Sat, 18 Jul 2020 11:06:47 +0000 (11:06 +0000)]
Merge branch 'wip/ricotz/annotations' into 'master'

gtk: Improve g-i annotations for methods of GtkExpression subclasses

See merge request GNOME/gtk!2263

5 years agogtk: Improve g-i annotations for methods of GtkExpression subclasses
Rico Tzschichholz [Sat, 18 Jul 2020 10:29:29 +0000 (12:29 +0200)]
gtk: Improve g-i annotations for methods of GtkExpression subclasses

5 years agoinspector: Clean up GtkInspectorGeneral
Matthias Clasen [Sat, 18 Jul 2020 04:31:04 +0000 (00:31 -0400)]
inspector: Clean up GtkInspectorGeneral

Drop the Private struct.

5 years agoinspector: Clean up GtkInspectorMiscInfo
Matthias Clasen [Sat, 18 Jul 2020 04:25:46 +0000 (00:25 -0400)]
inspector: Clean up GtkInspectorMiscInfo

Drop the Private struct.